<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义指令</title>

</head>
<body>
<div id="test">
    <p>{{content}}</p>
    <p v-text="content"></p>   <!--p.textContent = content-->
    <p v-html="content"></p>  <!--p.innerHTML = content-->
    <p ref="msg">abcd</p>
    <button @click="hint">提示</button>
</div>
<script type="text/javascript" src="../js/vue.js"></script>
<script>
    new Vue({
        el: '#test',
        data: {
            content: '<a href="http://www.baidu.com">百度一下</a>'
        },
        methods: {
            hint() {
                console.log(this.$refs.msg)
                alert(this.$refs.msg)
            }
        }
    })
</script>
</body>
</html>